<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<!-- meta使用viewport以确保页面可自由缩放 -->
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- 引入 jQuery Mobile 样式 -->
<link rel="stylesheet" href="/Public/Home/css/jquery.mobile-1.4.5.min.css">
<link rel="stylesheet" href="/Public/Home/css/vv.css">
<link rel="stylesheet" href="/Public/Home/iconfont/iconfont.css">
<!-- 引入 jQuery 库 -->
<script src="/Public/Home/js/jquery-1.11.3.min.js"></script>
<script src="/Public/Home/js/layer/layer.js"></script>
<!-- 引入 jQuery Mobile 库 -->
<script src="/Public/Home/js/jquery.mobile-1.4.5.min.js"></script>
<script src="/Public/Home/js/vv.js"></script>
</head>
<style>
.ui-btn-inline {
	width: 87%;
	margin-top: 2em;
	background-color: rgba(255,255,255,0) !important;
	text-shadow: none;
	border: none;
	box-shadow: none;
	background-color: #ffc703 !important;
	color: #333 !important;
	text-shadow: none !important;
}
.ui-shadow-inset {
	background-color: rgba(255,255,255,0) !important;
	text-shadow: none;
	border: none;
	box-shadow: none;
	background-color: rgba(0,0,0,0.5) !important;
}
</style>

<body>
<div data-role="page" class="bg_pic"> 
  <!-----------------------------头部 开始------------------------------>
  <div data-role="header" data-position="fixed" class="color_yellow1"> <a href="javascript:history.back(-1)" class="ui-btn ui-btn-icon-left border_none return"><</a>
    <h1 class="shadow_none">{$Think.lang.__ZHUCE__}</h1>
    <a href="#languege_btn" data-rel="popup" data-position-to="#languege" id="languege" class="ui-btn ui-btn-icon-left return langue_border">语言</a>
    <div data-role="popup" id="languege_btn" class="pad_05em" data-arrow="t">
      <ul class="switch_ul">
        <li><a class="switch_sty" href="?l=zh-cn">中文</a></li>
        <li><a class="switch_sty" href="?l=en-us">Englist</a></li>
        <li><a class="switch_sty" href="?l=zh-tw">繁體</a></li>
      </ul>
    </div>
  </div>
  <!-----------------------------头部 结束------------------------------> 
  <!-----------------------------主体内容 开始------------------------------>
  <div data-role="main" class="ui-content"> 
    <!------logo 开始------->
    <div class="">
      <div class="logo1_w70p"> <img src="/Public/Home/images/index_logo.png" width="100%"> </div>
    </div>
    <div class="clear"></div>
    <!------logo 结束-------> 
    <!------登录表单 开始------->
    <form class="w80p" method="post" action="" onsubmit="return false">
    <div class="ui-field-contain">
      <label for="username" class="ui-hidden-accessible">{$Think.lang.__SHURUZHANGHAODIANHUAHAO__}</label>
      <input type="text" name="username" id="username"   placeholder="{$Think.lang.__SHURUZHANGHAODIANHUAHAO__}" />
    </div>
    <div class="ui-field-contain">
      <label for="password1" class="ui-hidden-accessible">{$Think.lang.__QINGSHURUNIDEMIMA__}</label>
      <input type="password" name="password1" id="password1"  placeholder="{$Think.lang.__QINGSHURUNIDEMIMA__}">
    </div>
    <div class="ui-field-contain">
      <label for="password2" class="ui-hidden-accessible">{$Think.lang.__QINGZAICISHURUMIMA__}</label>
      <input type="password" name="password2" id="password2"  placeholder="{$Think.lang.__QINGZAICISHURUMIMA__}">
    </div>
    <div class="ui-field-contain verify" >
      <label for="verify1" class="ui-hidden-accessible">{$Think.lang.__SHOUJIYANZHENGMA__}</label>
      <input type="text" name="verify1" id="verify1"  placeholder="{$Think.lang.__SHOUJIYANZHENGMA__}">
	  <button id="btnbtn" data-inline="true" >{$Think.lang.__HUOQUYANZHENGMA__}</button>
    </div>
	<div class="ui-field-contain verify"  id="btnbtn"  >
      <label for="parentid" class="ui-hidden-accessible">{$Think.lang.__SHANGJIID__}</label>
      <input type="text" name="parentid" id="parentid"  placeholder="{$Think.lang.__SHANGJIID__}">
    
    </div>
	
    <input class="w100p" type="button" data-inline="true" onclick="ajaxSubmit();" value="{$Think.lang.__ZHUCE__}">
  </form>
    <!------登录表单 结束-------> 
    
  </div>
  <!-----------------------------主体内容 结束------------------------------> 
</div>
</body>
</html>
<script type="text/javascript">
	
	function ajaxSubmit(){
		var phone = $("#username").val();
		var code = $("#verify1").val();
		var password = $("#password1").val();
		var repwd = $("#password2").val();
		var parentid = $('#parentid').val();
		if(phone == ""){
			layer.msg("{$Think.lang.__QINGSHURUZHANGHAO__}");
			$("#username").focus();return false;
		}
		
		if(password == ""){
			layer.msg("{$Think.lang.__QINGCHONGZHIMIMA__}");
			$("#password1").focus();return false;
		}
		if(repwd == ""){
			layer.msg("{$Think.lang.__QINGZAICISHURUMIMA__}");
			$("#password2").focus();return false;
		}
		if(repwd != password){
			layer.msg("{$Think.lang.__MIMASHURUBUYIZHI__}");
			$("#password2").focus();return false;
		}
		if(code.length != 4){
			layer.msg("{$Think.lang.__QINGTIANXIEZHENGQUEYANZHENGMA__}");
			$("#verify1").focus();return false;
		}
		
		$.ajax({
			url:"{:U('Reg/reg')}",
			type:"POST",
			data:{'phone':phone,'code':code,'password':password,'repwd':repwd,'parentid':parentid},
			dataType:"JSON",
			success:function (data){
				layer.msg(data.info);
				if(data.status == 1){
					location.href = "{:U('Login/index')}";
				}
			}
		})
	}
</script>
<script>
	$(function(){
		$('#btnbtn').click(function(){
		var phone = $("#username").val();
		if(phone == ""){
			layer.msg("{$Think.lang.__SHURUZHANGHAODIANHUAHAO__}");
			$("#username").focus();return false;
		}
		
		//倒计时120秒
		var i=120;
        var tid2;
       
		$.ajax({
			url:"{:U('Login/sendPhone')}",
			type:"POST",
			data:{'phone':phone,type:2},
			dataType:"json",
			success:function (data){
				layer.msg(data.info);
				if(data.status == 1){
					 tid2=setInterval(function(){
		
				  
						$('#btnbtn').attr("disabled",true);
						
						i--;
						$('#btnbtn').html(i+"秒后可重新发送");
						if(i<=0){
							$('#btnbtn').removeAttr("disabled").html("重新发送验证码");
							
							clearInterval(tid2);
						}
				
					},1000);
				}
			}
		})
		
	})
		
	
	
	})
	
</script>
<script>
$(document).ready(function() {
   $(".foot_btns a").on("tap",function(){
	$(".foot_btns").children(".foot_block").eq(0).addClass("active").siblings(".foot_block").removeClass("active");   
   })
});
</script>